﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;

namespace MyUtilityApp
{
    public partial class AboutPage : PhoneApplicationPage
    {
        public AboutPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            string artist = "";
            NavigationContext.QueryString.TryGetValue("Artist", out artist);
            txtArtistName.Text = artist;
        }

        private void emailButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            EmailComposeTask email = new EmailComposeTask();
            email.To = (String) emailButton.Content;
            email.Subject = "Feedback";
            email.Body = "";
            email.Show();
        }

        private void callButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            PhoneCallTask phone = new PhoneCallTask();
            phone.DisplayName = "Maboy";
            phone.PhoneNumber =  "02222222";
            phone.Show();
            /**
            SmsComposeTask sms = new SmsComposeTask();
            sms.To = "0222222";
            sms.Body = "hello";
            sms.Show();
             * */
        }

        private void mapButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            MapsTask map = new MapsTask();
            //  40.2441 /  126.3762
            map.SearchTerm = "Sole, Korea";
            map.Center = new System.Device.Location.GeoCoordinate(40.2441, 126.3762);
            map.ZoomLevel = map.ZoomLevel * 10;
            map.Show();

            /**
            WebBrowserTask web = new WebBrowserTask();
            web.Uri = new Uri("http://maboy.com");
            web.Show();
             * */

            /**
            MediaPlayerLauncher media = new MediaPlayerLauncher();
            media.Media = new Uri("/videos/maboy.mp4", UriKind.Relative);
            media.Show();
             * */
        }
    }
}